<?php
	/*
	* file: init.php
	*
	* contents:	includes all modules needed, defines global variables and manages user login.
	*				It's needed by all pages to be constructed. As this file is included by 
	*				almost pages, login data are always checked. This avoid malicious users
	*				to avoid login by opening directly an internal page.
	*
	* author: Federico Zanco
	*/



	/*
	* var: $docFieldsName
	*
	* contents:	keeps names of table documents's fields. It's needed mainly by errorsManagerMod
	*/

	$docFieldsName = array( 'doc_num',
							'description',
							'expires',
							'date',
							'binary',
							'filename',
							'from',
							'to',
							'created_by',
							'inserted_by',
							'type',
							'department',
							'from_date',
							'to_date',
							'MIME',
							'size');



	/*
	*	var: $docFieldsNameLocale
	*
	*	contents:	keeps names of table documents's fields translated. It's needed mainly by errorsManagerMod
	*/

	$docFieldsNameLocale =	array( 	'doc_num',
									'Descrizione',
									'Validit&agrave;', 
									'Data documento',
									'Binario',
									'Documento',
									'Proveniente da',
									'Diretto a',
									'Creato da',
									'Inserito da',
									'Tipologia del documento',
									'Settore di competenza',
									'Dal',
									'Al',
									'MIME',
									'Dimensione');



	/*
	* var: $con
	*
	* contents:	global var that keep db connection. It's used by almost all pages.
	*/

	$con = null;



	/*
	* var: $lastRev
	*
	* contents:	DoGe Web last revision date
	*/

	$lastRev = "14/09/2007";



	//include main UI structure module
	include ("modules/pageStructUIMod.php");

	//include functions to construct contents area forms, results tables...
	include ("modules/pageContentsUIMod.php");

	//include functions to access to mysql DB
	include ("modules/mysqlMod.php");

	//include functions to check login user data and permissions
	include("modules/loginMod.php");

	//include functions to check errors in input forms values
	include ("modules/errorsManagerMod.php");

	//make a check of session/login username and password
	checkLogin(0);

	//connect to mysql database
	$con = connect();

	//check user permissions
	checkPermissions();

?>